<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:include="~{common/header :: commonHead}">
    <title>活动详情</title>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5 th:text="${null == editable ? '添加活动' : '编辑活动'}"></h5>
                    <div class="ibox-tools">
                    </div>
                </div>

                <div class="ibox-content">
                    <form class="row form-body form-horizontal m-t" method="post"
                          th:action="${null == editable ? '/marketActivity/turnTable/add' : '/marketActivity/turnTable/add'}">
                        <input name="id" th:value="${editable?.id}" style="display: none">
                        <div class="col-md-12 droppable sortable ui-droppable ui-sortable">
                            <div class="form-group draggable ui-draggable dropped" style="position: static;">
                                <label class="col-sm-3 control-label">活动名称：</label>
                                <div class="col-sm-6">
                                    <input type="text" name="name" class="form-control"
                                           th:value="${editable?.name }" required="required" placeholder="请输入商户名称">
                                </div>
                            </div>
                            <div th:if="${null != editable}" class="form-group draggable ui-draggable dropped"
                                 style="position: static;">
                                <label class="col-sm-3 control-label">创建时间：</label>
                                <div class="col-sm-6">
                                    <input type="text" name="createTime" required="required" class="form-control" th:value="${editable?.createTime}" disabled>
                                </div>
                            </div>
                            <div class="form-group draggable ui-draggable dropped"  style="position: static;">
                                <label class="col-sm-3 control-label">活动开始时间：</label>
                                <div class="col-sm-2">
                                    <div class="input-group date">
                                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                        <input type="text" class="form-control" readonly placeholder="开始时间" id="buy_time_start" th:value="${editable?.startTime}" name="startTime" required>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group draggable ui-draggable dropped" style="position: static;">
                                <label class="col-sm-3 control-label">活动结束时间：</label>
                                <div class="col-sm-2">
                                    <div class="input-group date">
                                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                        <input type="text" class="form-control" th:value="${editable?.endTime }" readonly placeholder="结束时间" id="buy_time_end" name="endTime" required="required">
                                    </div>
                                </div>
                            </div>
                            <div class="form-group draggable ui-draggable dropped" style="position: static;">
                                <label class="col-sm-3 control-label">活动规则：</label>
                                <div class="col-sm-6" >
                                    <textarea class="myEditor" placeholder="请输入活动规则" name="description" th:utext="${editable?.description}"></textarea>
                                </div>
                            </div>
                            <div class="form-group draggable ui-draggable dropped" style="position: static;">
                                <label class="col-sm-3 control-label">是否上架：</label>
                                <div class="col-sm-6">
                                    <label class="radio-inline">
                                        <input type="radio" th:checked="${editable?.status == 1}" value="1"
                                               name="status">是
                                    </label>
                                    <label class="radio-inline">
                                        <input type="radio" th:checked="${editable?.status == 0}" value="0"
                                               name="status">否
                                    </label>
                                </div>
                            </div>

                            <div class="hr-line-dashed"></div>

                            <div class="form-group draggable ui-draggable">
                                <div class="col-sm-12 col-sm-offset-3">
                                    <button class="btn btn-primary" type="submit">保存内容</button>
                                </div>
                            </div>

                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>